package l1j.server.server.model.shop;

import l1j.server.server.datatables.RaceTicketTable;
import l1j.server.server.model.Instance.L1ItemInstance;
import l1j.server.server.templates.L1RaceTicket;

public class L1AssessedItem {
        private final int _targetId , _itemId;
        private int _assessedPrice;
        private final L1ItemInstance _item;
        L1AssessedItem(final int targetId,final int assessedPrice , final L1ItemInstance item) {
        		_item = item;
                _targetId = targetId;
                _itemId = _item.getItemId();
                
                if (_itemId != 40309) {
                    _assessedPrice = assessedPrice;
                } else {// 賭肥票券
                        final L1RaceTicket ticket = RaceTicketTable.getInstance().getTemplate(_targetId);
                        int price = 0;
                        if (ticket != null) {
                         price = (int) (assessedPrice * ticket.get_allotment_percentage() * ticket.get_victory());
                        }
                        
                        _assessedPrice = price;
                }
        }

        public int getTargetId() {
                return _targetId;
        }

        public int getAssessedPrice() {
                return _assessedPrice;
        }
        
        public int getItemId(){
        	return _itemId;
        }
        public L1ItemInstance getItemInstance(){
        	return _item;
        }
}